<? $form = new Form(); ?>

<? if(!empty($errors)){?>
   <div id="login_form_error_messages">
   <? foreach($errors as $error => $text){?>
    <div><?= $text ?></div>
   <? } ?>
   </div>
<? }?>

<?
  if(isset($uri)){
    echo $form->open('user/login/' . $uri);
  }else{
    echo $form->open('user/login');
  }
?>
<fieldset id="login_fieldset">
<legend>Log in</legend>

<?= $form->input('token_form', Security::token(), array('type' => 'hidden')) ?>

<?= $form->label('username'); ?>
<?= $form->input('username', NULL, array('type' => 'text', 'maxlength' => 50)); ?>

<?= $form->label('password'); ?>
<?= $form->input('password', NULL, array('type' => 'password', 'maxlength' => 50)); ?>

<?= $form->label('remember'); ?>
<?= $form->checkbox('remember', 1, FALSE); ?>

<?= $form->submit('login', 'Log in') ?>

</fieldset>
<?= $form->close(); ?>